/**
 * @Author MrsGuo
 * version 1.0
 * @Date 2023-08-03 15:14
 */
package com.cl.erp_2301.controller;

import com.cl.erp_2301.Service.MenuService;
import com.cl.erp_2301.dto.MenuDTO;
import com.cl.erp_2301.util.Result;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("/v2/menu")
public class MenuController {
    @Resource
    private MenuService menuService;

    @GetMapping("/select")
    public Result login(HttpServletRequest request, HttpServletResponse response) throws IOException {
        Integer uuid = (Integer) request.getSession().getAttribute("uuid");
        List<MenuDTO> menuDTOList = menuService.selectMenuList(uuid);
        return Result.ok(menuDTOList);
    }
}
